import Vue from 'vue'
import App from './App'
import uView from "uview-ui";
Vue.use(uView);

import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
Vue.component('mescroll-body', MescrollBody)
Vue.component('mescroll-uni', MescrollUni)

const imgUrl = 'http://saasapi.ewguan.com/Resource/App/img'


Vue.filter('imgUrl',function(url){
	return imgUrl+url
})

Vue.filter('dateFormat', function (strTime) {
	if(!strTime) return ''
	strTime = strTime.replace(/T/g, ' '); //去掉T
	strTime = strTime.replace(/-/g, '/');
	strTime = strTime.replace(/\.\d+/, ' ');//去掉毫秒
	//var myDate = new Date(strTime + '+0800');
	return strTime;
})

Vue.filter('datetimeFormat', function (strTime) {
	strTime = strTime.replace(/T/g, ' '); //去掉T
	strTime = strTime.replace(/-/g, '/');
	strTime = strTime.replace(/\.\d+/, ' ');//去掉毫秒
	strTime = strTime.substr(0,10);//去掉时分秒
	//var myDate = new Date(strTime + '+0800');
	return strTime;
})

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
  ...App
})



// http拦截器
import httpInterceptor from '@/common/http.interceptor.js'
// 这里需要写在最后，是为了等Vue创建对象完成，引入"app"对象(也即页面的"this"实例)
Vue.use(httpInterceptor, app)

// http接口API集中管理引入部分
import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app)

app.$mount()
